<template>
  <div class="table-content">
    <el-descriptions title="">
      <el-descriptions-item label="巡检人名称">{{detailInfo?.userName}}</el-descriptions-item>
      <el-descriptions-item label="巡检日期">{{detailInfo?.inspectTime}}</el-descriptions-item>
      <el-descriptions-item label="模型表名称">{{detailInfo?.modelName}}</el-descriptions-item> 
    </el-descriptions>

    <el-table ref="multipleTableRef" :data="detailList" style="width: 100%">
      <el-table-column property="equipmentName" label="设备名称" show-overflow-tooltip />
      <el-table-column property="equipmentNumber" label="设备厂家及型号" />
      <el-table-column property="equipmentLocation" label="设备位置" />
      <el-table-column property="frontLamp" label="前面板指示灯">
        <template #default="scope">
          {{ resultYN[scope.row.frontLamp] || '-'}}
        </template>
      </el-table-column>
      <el-table-column property="powerLamp" label="电源指示灯">
        <template #default="scope">
          {{ resultYN[scope.row.powerLamp] || '-'}}
        </template>
      </el-table-column>
      <el-table-column property="fan" label="风扇运转状态">
        <template #default="scope">
          {{ resultYN[scope.row.fan] || '-'}}
        </template>
      </el-table-column>
      <el-table-column property="networkConnection" label="网络连接状态">
        <template #default="scope">
          {{ resultYN[scope.row.networkConnection] || '-'}}
        </template>
      </el-table-column>
      <el-table-column property="cpu" label="CPU及内存使用情况">
        <template #default="scope">
          {{ resultYN[scope.row.cpu] || '-'}}
        </template>
      </el-table-column>
      <el-table-column property="abnormalLog" label="是否有异常日志">
        <template #default="scope">
          {{ resYN[scope.row.abnormalLog] || '-'}}
        </template>
      </el-table-column>
      <el-table-column property="totality" label="总体状况">
        <template #default="scope">
          {{ totality[scope.row.totality] || '-'}}
        </template>
      </el-table-column>
      <el-table-column property="inspectionAnalysis" label="巡检分析"> </el-table-column>
    </el-table>

    <!-- <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> -->
  </div>
</template>

<script setup lang="ts">
import { inspecWorkPropertylDetailList ,inspectDetailList } from "@/api/inspection";

const resultYN = ref(['正常','不正常'])
const resYN = ref(['是','否'])
const totality = ref(['良好','偶尔出现故障','经常出现故障','不可使用'])

const props = defineProps(['rowId'])




const detailInfo = ref([])
const detailList = ref([])
const getDetrailList = async()=>{
    const res = await inspectDetailList(props.rowId)
    console.log(res);
    detailList.value = res.data.networkVos
    detailInfo.value = res.data
}
watchEffect(async () => {
  console.log(props.rowId);
  if(props.rowId){
    await getDetrailList()
  }
});
</script>

<style scoped></style>
